#ifndef LEVEL_H_INCLUDED
#define LEVEL_H_INCLUDED
#include <iostream>
#include <sstream>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Audio.hpp>

class ImgMgr;
class Tile;
class Mob;
class FleshTile;
class LadderTile;
class PortalTile;
class RegenTile;
class InfectedFleshTile;
class PikeMob;
class BacteriaMob;
class Player;
class Ball;

class Level
{
public:
	Level();
	~Level();
	void loadLevel(std::string chemin, Player *player);
	void init(ImgMgr *imageManager);
	void render(sf::RenderWindow *app, Player *player);
	void majEntity(Player *player);
	void addBall(const sf::Vector2f position, const float moveX, const float moveY);
	void delMob(Mob *mob);
	void addMob(Mob *mob, const sf::Vector2f position);
	bool entityCollisionTile(const sf::Vector2f position, const int u, const int direction);
	bool entityInTile(const sf::Vector2f position, const int u, const std::string nameTile, const sf::Vector2f hitBox);
	Tile* getTile(int x, int y, const int u);
	void setTile(Tile *tile, const int x, const int y, const int u);
	bool getFinishLevel() const;

private:
    ImgMgr *m_imageManager;
	Tile *m_tile[3][40][128];
	int m_width;
	int m_height;
	int m_currentLevel;
	sf::Texture m_imageWall;
	sf::Sprite m_spriteWall;
	std::vector<Ball*> m_ball;
	std::vector<Mob*> m_mob;
	int m_numberMob;
    sf::Sound m_soundDead;
    sf::SoundBuffer m_bufferDead;
    bool m_finishedGame;
};



#endif /* LEVEL_H_ */
